<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class FeedBack extends Model
{
    public $table = 'feedback';
    public static function getFeedBackList($input)
    {
       $data = self::join('user','user.id','=','feedback.uid')
           ->select('feedback.*','user.user_name','user.user_nickname');

        if (!empty($input)){
            $val  = $input['val'];
            $val  = json_decode($val,true);
            asort($val);
            $val  = array_values($val);
            $data = $data->whereBetween('feedback.created_at',$val);
        }

       return $data ->get()->toArray();
    }
}
